
#ifndef ESRENDERER_H
#define ESRENDERER_H

// INCLUDES ********************************************************************

#import <OpenGLES/EAGL.h>

#import <OpenGLES/ES1/gl.h>

#import <OpenGLES/ES1/glext.h>

#import <OpenGLES/EAGLDrawable.h>

#import <QuartzCore/QuartzCore.h>


// FORWARD DECLARATIONS ********************************************************

// *****************************************************************************

//! ESRenderer
//! 
//! Protocol declaring functions a concrete OpenGL ES renderer will have
//! to implement to operate correctly.

// *****************************************************************************

@interface ESRenderer : NSObject
{
    //! the context the renderer is working in
    EAGLContext* mGLContext;
    
    //! the wrapping CA layer, will be set from the EAGLView
    CAEAGLLayer* mLayer;
    
    //! two buffers, one off, one on screen for rendering
    GLuint mRenderbuffer;
    
    GLuint mFramebuffer;
}

- ( id)initWithCALayer:( CAEAGLLayer*) layer;

- ( BOOL)createFrameBuffers;

- ( void)rendersBuffers;

- ( void)destroyFramebuffers;

@end


#endif
